home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / MPW / gzip 1.2.2 / tailor.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-27  |  6.5 KB  |  300 lines  |  [TEXT/MPS ]

  1. /* tailor.h -- target dependent definitions
  2.  * Copyright (C) 1992-1993 Jean-loup Gailly.
  3.  * This is free software; you can redistribute it and/or modify it under the
  4.  * terms of the GNU General Public License, see the file COPYING.
  5.  */
  6.  
  7. /* The target dependent definitions should be defined here only.
  8.  * The target dependent functions should be defined in tailor.c.
  9.  */
  10.  
  11. /* $Id: tailor.h,v 0.18 1993/06/14 19:32:20 jloup Exp $ */
  12.  
  13. #if defined(__MSDOS__) && !defined(MSDOS)
  14. #  define MSDOS
  15. #endif
  16.  
  17. #if defined(__OS2__) && !defined(OS2)
  18. #  define OS2
  19. #endif
  20.  
  21. #if defined(OS2) && defined(MSDOS) /* MS C under OS/2 */
  22. #  undef MSDOS
  23. #endif
  24.  
  25. #ifdef MSDOS
  26. #  ifdef __GNUC__
  27.      /* DJGPP version 1.09+ on MS-DOS.
  28.       * The DJGPP 1.09 stat() function must be upgraded before gzip will
  29.       * fully work.
  30.       * No need for DIRENT, since <unistd.h> defines POSIX_SOURCE which
  31.       * implies DIRENT.
  32.       */
  33. #    define near
  34. #  else
  35. #    define MAXSEG_64K
  36. #    ifdef __TURBOC__
  37. #      define NO_UTIME
  38. #      define NO_OFF_T
  39. #    else /* MSC */
  40. #      define HAVE_SYS_UTIME_H
  41. #      define NO_UTIME_H
  42. #    endif
  43. #  endif
  44. #  define PATH_SEP2 '\\'
  45. #  define PATH_SEP3 ':'
  46. #  define MAX_PATH_LEN  128
  47. #  define NO_MULTIPLE_DOTS
  48. #  define MAX_EXT_CHARS 3
  49. #  define Z_SUFFIX "z"
  50. #  define NO_CHOWN
  51. #  define PROTO
  52. #  define STDC_HEADERS
  53. #  define NO_SIZE_CHECK
  54. #  define casemap(c) tolow(c) /* Force file names to lower case */
  55. #  include <io.h>
  56. #  define OS_CODE  0x00
  57. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  58. #  if !defined(NO_ASM) && !defined(ASMV)
  59. #    define ASMV
  60. #  endif
  61. #else
  62. #  define near
  63. #endif
  64.  
  65. #ifdef OS2
  66. #  define PATH_SEP2 '\\'
  67. #  define PATH_SEP3 ':'
  68. #  define MAX_PATH_LEN  260
  69. #  ifdef OS2FAT
  70. #    define NO_MULTIPLE_DOTS
  71. #    define MAX_EXT_CHARS 3
  72. #    define Z_SUFFIX "z"
  73. #  endif
  74. #  define NO_CHOWN
  75. #  define PROTO
  76. #  define STDC_HEADERS
  77. #  define casemap(c) tolow(c)
  78. #  include <io.h>
  79. #  define OS_CODE  0x06
  80. #  define SET_BINARY_MODE(fd) setmode(fd, O_BINARY)
  81. #  ifdef _MSC_VER
  82. #    define HAVE_SYS_UTIME_H
  83. #    define NO_UTIME_H
  84. #    define MAXSEG_64K
  85. #    undef near
  86. #    define near _near
  87. #  endif
  88. #  ifdef __EMX__
  89. #    define HAVE_SYS_UTIME_H
  90. #    define NO_UTIME_H
  91. #    define DIRENT
  92. #    define EXPAND(argc,argv) \
  93.        {_response(&argc, &argv); _wildcard(&argc, &argv);}
  94. #  endif
  95. #  ifdef __BORLANDC__
  96. #    define DIRENT
  97. #  endif
  98. #  ifdef __ZTC__
  99. #    define NO_DIR
  100. #    define NO_UTIME_H
  101. #    include <dos.h>
  102. #    define EXPAND(argc,argv) \
  103.        {response_expand(&argc, &argv);}
  104. #  endif
  105. #endif
  106.  
  107. #ifdef MSDOS
  108. #  ifdef __TURBOC__
  109. #    include <alloc.h>
  110. #    define DYN_ALLOC
  111.      /* Turbo C 2.0 does not accept static allocations of large arrays */
  112.      void * fcalloc (unsigned items, unsigned size);
  113.      void fcfree (void *ptr);
  114. #  else /* MSC */
  115. #    include <malloc.h>
  116. #    define fcalloc(nitems,itemsize) halloc((long)(nitems),(itemsize))
  117. #    define fcfree(ptr) hfree(ptr)
  118. #  endif
  119. #else
  120. #  ifdef MAXSEG_64K
  121. #    define fcalloc(items,size) calloc((items),(size))
  122. #  else
  123. #    define fcalloc(items,size) malloc((size_t)(items)*(size_t)(size))
  124. #  endif
  125. #  define fcfree(ptr) free(ptr)
  126. #endif
  127.  
  128. #if defined(VAXC) || defined(VMS)
  129. #  define PATH_SEP ']'
  130. #  define PATH_SEP2 ':'
  131. #  define SUFFIX_SEP ';'
  132. #  define NO_MULTIPLE_DOTS
  133. #  define Z_SUFFIX "-gz"
  134. #  define RECORD_IO 1
  135. #  define casemap(c) tolow(c)
  136. #  define OS_CODE  0x02
  137. #  define OPTIONS_VAR "GZIP_OPT"
  138. #  define STDC_HEADERS
  139. #  define NO_UTIME
  140. #  define EXPAND(argc,argv) vms_expand_args(&argc,&argv);
  141. #  include <file.h>
  142. #  define unlink delete
  143. #  ifdef VAXC
  144. #    define NO_FCNTL_H
  145. #    include <unixio.h>
  146. #  endif
  147. #endif
  148.  
  149. #ifdef AMIGA
  150. #  define PATH_SEP2 ':'
  151. #  define STDC_HEADERS
  152. #  define casemap(c) tolow(c) /* Force file names to lower case */
  153. #  define OS_CODE  0x01
  154. #  define ASMV
  155. #  ifdef __GNUC__
  156. #    define DIRENT
  157. #    define HAVE_UNISTD_H
  158. #  else /* SASC */
  159. #    define NO_STDIN_FSTAT
  160. #    define SYSDIR
  161. #    define NO_SYMLINK
  162. #    define NO_CHOWN
  163. #    define NO_FCNTL_H
  164. #    include <fcntl.h> /* for read() and write() */
  165. #    define direct dirent
  166.      extern void _expand_args(int *argc, char ***argv);
  167. #    define EXPAND(argc,argv) _expand_args(&argc,&argv);
  168. #    undef  O_BINARY /* disable useless --ascii option */
  169. #  endif
  170. #endif
  171.  
  172. #if defined(ATARI) || defined(atarist)
  173. #  ifndef STDC_HEADERS
  174. #    define STDC_HEADERS
  175. #    define HAVE_UNISTD_H
  176. #    define DIRENT
  177. #  endif
  178. #  define ASMV
  179. #  define OS_CODE  0x05
  180. #  ifdef TOSFS
  181. #    define NO_SYMLINK
  182. #    define NO_MULTIPLE_DOTS
  183. #    define MAX_EXT_CHARS 3
  184. #    define Z_SUFFIX "z"
  185. #    define NO_CHOWN
  186. #  endif
  187. #endif
  188.  
  189. #ifdef macintosh
  190. #  define PATH_SEP ':'
  191. #  define MAX_PATH_LEN  255
  192. #  define STDC_HEADERS
  193. #  define DIRENT
  194. #  define DYN_ALLOC
  195. #  define NO_SYMLINK
  196. #  define NO_CHOWN
  197. #  define NO_UTIME
  198. #  define chmod(file, mode) (0)
  199. #  define OPEN(name, flags, mode) open(name, flags)
  200. #  define OS_CODE  0x07
  201. #endif
  202.  
  203. #ifdef __50SERIES /* Prime/PRIMOS */
  204. #  define PATH_SEP '>'
  205. #  define STDC_HEADERS
  206. #  define NO_MEMORY_H
  207. #  define NO_UTIME_H
  208. #  define NO_UTIME
  209. #  define NO_CHOWN 
  210. #  define NO_STDIN_FSTAT 
  211. #  define NO_SIZE_CHECK 
  212. #  define NO_SYMLINK
  213. #  define RECORD_IO  1
  214. #  define casemap(c)  tolow(c) /* Force file names to lower case */
  215. #  define put_char(c) put_byte((c) & 0x7F)
  216. #  define get_char(c) ascii2pascii(get_byte())
  217. #  define OS_CODE  0x0F    /* temporary, subject to change */
  218. #  ifdef SIGTERM
  219. #    undef SIGTERM         /* We don't want a signal handler for SIGTERM */
  220. #  endif
  221. #endif
  222.  
  223. #ifdef WIN32
  224. #  define OS_CODE  0x0b
  225. #endif
  226.  
  227. #ifdef TOPS20
  228. #  define OS_CODE  0x0a
  229. #endif
  230.  
  231. #ifndef unix
  232. #  define NO_ST_INO /* don't rely on inode numbers */
  233. #endif
  234.  
  235.  
  236.     /* Common defaults */
  237.  
  238. #ifndef OS_CODE
  239. #  define OS_CODE  0x03  /* assume Unix */
  240. #endif
  241.  
  242. #ifndef PATH_SEP
  243. #  define PATH_SEP '/'
  244. #endif
  245.  
  246. #ifndef casemap
  247. #  define casemap(c) (c)
  248. #endif
  249.  
  250. #ifndef OPTIONS_VAR
  251. #  define OPTIONS_VAR "GZIP"
  252. #endif
  253.  
  254. #ifndef Z_SUFFIX
  255. #  define Z_SUFFIX ".gz"
  256. #endif
  257.  
  258. #ifdef MAX_EXT_CHARS
  259. #  define MAX_SUFFIX  MAX_EXT_CHARS
  260. #else
  261. #  define MAX_SUFFIX  30
  262. #endif
  263.  
  264. #ifndef MAKE_LEGAL_NAME
  265. #  ifdef NO_MULTIPLE_DOTS
  266. #    define MAKE_LEGAL_NAME(name)   make_simple_name(name)
  267. #  else
  268. #    define MAKE_LEGAL_NAME(name)
  269. #  endif
  270. #endif
  271.  
  272. #ifndef MIN_PART
  273. #  define MIN_PART 3
  274.    /* keep at least MIN_PART chars between dots in a file name. */
  275. #endif
  276.  
  277. #ifndef EXPAND
  278. #  define EXPAND(argc,argv)
  279. #endif
  280.  
  281. #ifndef RECORD_IO
  282. #  define RECORD_IO 0
  283. #endif
  284.  
  285. #ifndef SET_BINARY_MODE
  286. #  define SET_BINARY_MODE(fd)
  287. #endif
  288.  
  289. #ifndef OPEN
  290. #  define OPEN(name, flags, mode) open(name, flags, mode)
  291. #endif
  292.  
  293. #ifndef get_char
  294. #  define get_char() get_byte()
  295. #endif
  296.  
  297. #ifndef put_char
  298. #  define put_char(c) put_byte(c)
  299. #endif
  300.